#region using statements

using AeonOfStrifeDatatypes.Combat;
using AeonOfStrifeDatatypes.Units;

#endregion

namespace AeonOfStrife.Objects.Units
{
	public struct AttackInfo
	{
		internal readonly AnimationInfo m_animationInfo;

		internal readonly AnimationInfo m_projectileInfo;

		internal float m_attackChance;

		internal float m_attackDelay;

		internal AttackType m_attackType;

		internal DamageValues m_baseDamage;

		internal float m_bonusAttackDelayDecreasePerLevel;

		internal DamageValues m_bonusDamagePerUpgradeLevel;

		internal float m_effectiveAttackDelay;

		internal DamageValues m_effectiveDamageValues;

		public AttackInfo(AttackInfoXMLReader p_info) {
			m_animationInfo = new AnimationInfo(p_info.AttackAnimationInfo);
			m_projectileInfo = new AnimationInfo(p_info.ProjectileAnimationInfo);
			m_attackDelay = p_info.AttackDelay;
			m_bonusAttackDelayDecreasePerLevel = p_info.BonusAttackDelayDecreasePerLevel;
			m_effectiveAttackDelay = m_attackDelay;
			m_attackChance = p_info.AttackChance;
			m_attackType = p_info.AttackType;
			m_baseDamage = p_info.BaseDamage;
			m_effectiveDamageValues = m_baseDamage;
			m_bonusDamagePerUpgradeLevel = p_info.BonusDamagePerUpgradeLevel;
		}

		public float AttackDelay {
			get { return m_effectiveAttackDelay; }
		}

		public DamageValues DamageValues {
			get { return m_effectiveDamageValues; }
		}
	}
}